package com.zhulanhua.blogs.Utils;

import lombok.Data;

@Data
public class Result<T> {
    private T data;//响应数据
    private Integer code;//响应码
    private String msg;//响应消息

    public Result() {
    }

    public Result(Integer code, T data) {
        this.data = data;
        this.code = code;
    }

    public Result(Integer code, T data, String msg) {
        this.data = data;
        this.code = code;
        this.msg = msg;
    }

    public static Result ok(){
        return new Result(Code.OK,null);
    }

    public static Result ok(Object t){
        return new Result(Code.OK,t);
    }
}
